4f1b4259a19327bd4798dbaf698a7092857ae399,functional-test/src/test/java/org/zanata/feature/account/ChangePasswordTest.java,ChangePasswordTest,changePasswordCurrentPasswordFailure,#,67

Before Change


   public void changePasswordCurrentPasswordFailure()
   {
      String incorrectPassword = "Old password is incorrect, please check and try again.";
      MyAccountPage myAccountPage = new LoginWorkFlow().signIn("translator", "translator").goToMyProfile();
         ChangePasswordPage changePasswordPage = myAccountPage.goToChangePassword()
            .enterOldPassword("nottherightpassword")
            .enterNewPassword("somenewpassword")
            .enterConfirmNewPassword("somenewpassword")
            .changePasswordExpectingFailure();

      assertThat("Incorrect password message displayed", changePasswordPage.getErrors(),
            Matchers.contains(incorrectPassword));

After Change


   {
      String incorrectPassword = "Old password is incorrect, please check and try again.";
      ChangePasswordPage changePasswordPage = new LoginWorkFlow().signIn("translator", "translator")
            .goToMyProfile()
            .goToChangePassword()
            .enterOldPassword("nottherightpassword")
            .enterNewPassword("somenewpassword")
            .enterConfirmNewPassword("somenewpassword")
            .changePasswordExpectingFailure();

      assertThat("Incorrect password message displayed", changePasswordPage.getErrors(),
            Matchers.contains(incorrectPassword));